import { computed } from "vue";
import { useRoute } from "vue-router";
// import { useAuthStore } from "@/stores/modules/auth";
// todo: 按钮权限，从api接口获取，piana管理
/**
 * @description 页面按钮权限
 * */
export const useAuthButtons = () => {
  const route = useRoute();
  // const authStore = useAuthStore();
  const authButtons = {}; // authStore.authButtonListGet[route.name as string] || [];

  const BUTTONS = computed(() => {
    const currentPageAuthButton: { [key: string]: boolean } = {};
    authButtons.forEach((item) => (currentPageAuthButton[item] = true));
    return currentPageAuthButton;
  });

  return {
    BUTTONS,
  };
};
